import request from '@/utils/request'

export function listFormula(query) {
  return request({
    url: '/formula/list',
    method: 'get',
    params: query
  })
}

export function simpleListFormula(query) {
  return request({
    url: '/formula/simpleList',
    method: 'get',
    params: query
  })
}

export function createFormula(data) {
  return request({
    url: '/formula/create',
    method: 'post',
    data
  })
}

export function readFormula(formulaId) {
  return request({
    url: '/formula/read',
    method: 'get',
    params: { formulaId }
  })
}

export function changeMaterialNum(data) {
  return request({
    url: '/formula/changeMaterialNum',
    method: 'post',
    data
  })
}

export function updateFormula(data) {
  return request({
    url: '/formula/update',
    method: 'post',
    data
  })
}

export function deleteFormula(data) {
  return request({
    url: '/formula/delete',
    method: 'post',
    data
  })
}
